package com.wyu.servlet;

import com.wyu.dao.SCDao;
import com.wyu.dao.SCDaoImpl;
import com.wyu.dao.YGDao;
import com.wyu.dao.YGDaoImpl;
import com.wyu.pojo.SC;
import com.wyu.pojo.YG;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
import java.util.List;

@WebServlet("/SCServlet")
public class SCServlet extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        HttpSession session = request.getSession();
        SCDao dao = new SCDaoImpl();
        List<SC> list = dao.searchsc();
        session.setAttribute("sc",list);
        response.sendRedirect("hwxx.jsp");
        request.getSession().setAttribute("Changed_message","");
    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doPost(request,response);
    }
}
